.section entry, "ax"
.globl _start
_start:
    jal _stack_init
    jal _heap_init
    jal main
    jal _halt

_stack_init:
    li sp, 0xF0000000
    ret

_heap_init:
    addi sp, sp, -16
    sd   ra, 8(sp)
    li   a0, 0xA0000000 # heap start
    li   a1, 0xE0000000 # heap end
    jal  YemuMallocInit # call C function
    ld   ra, 8(sp)
    addi sp, sp, 16
    ret

.globl _halt
_halt:
    j  _halt

